//
//  ZWNavigationController.swift
//  weiboXue
//
//  Created by xue-iOS-work on 16/8/29.
//  Copyright © 2016年 iOS-work. All rights reserved.
//

import UIKit

class ZWNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if childViewControllers.count>0 {
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", style: .plain, target: self, action: #selector(back))
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: true)
        
    }
    func back() -> Void {
        _ = popViewController(animated: true)
    }

}
